package org.example.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.model.UserInfo;

@Mapper
public interface UserMapper {

    @Select("select id, user_name, password, github_url, delete_flag, create_time from user where user_name = #{username}")
    UserInfo selectUserByName(String username);

    @Select("select id, user_name, password, github_url, delete_flag, create_time from user where id = #{userId}")
    UserInfo selectUserById(Integer userId);

    @Select("select user_id from blog where id = #{blogId}")
    Integer getUserIdByBlogId(Integer blogId);
}
